#!/usr/bin/env ruby
# ===== Yahoo LifeType demo For Ruby - listClasses =====
# Coded by CFC < zusocfc at gmail dot com >

APPID = "NhYX9XjV34FPxdq7zD8T7wwc4QGI5VWu_48NHh03zbPYUfPpcWrpZzhcVDKFQsH9dQ--"
require 'lifetype'
require 'rexml/document'
include REXML, LifeType
biz = Biz.new(APPID)
puts "讀取商家資料中... 請稍後"
rsp = Document.new(biz.getDetails("3f2a47d5e38f3076")).root.elements[1]
puts "商家資料讀取完畢... 列出資料中"
for field in %w"Name Address Tel Fax Url Email Card Booking ParkingLot ParkingService Hour"
  puts "#{field} -- #{rsp.elements[field].text}" if rsp.elements[field].has_text?
end
puts "商家資料列出完畢... 結束"